App.EditClient= function(ds, record) {
 	//var a = record.get("pay_kind");
 	
	var formPanel = new Ext.FormPanel
	//(整个form  
	  ({
	        labelAlign: 'left',//定义label标识是靠左left ，靠上top，右面right
	        frame : true,
			url :'../'+WebServiceUrl,
	        bodyStyle:'padding:5px',
	        width: 600,       
	        items: [{
	//(主信息             
	            layout:'column',
	            border:false,             
	            items:[{
		                  columnWidth:.5,
		                  layout: 'form',
		                  border:false,    
		                  items: [{
					              xtype:'textfield',
					              fieldLabel: '客户名称',
					              name: 'customername',
					              id:'customername',
					              anchor:'95%'
		                         },{
					              xtype:'textfield',
					              fieldLabel: '法人名称',
					              name: 'corporator',
					              id:'corporator',
					              //value :record.get("corporator"),
					              anchor:'95%'
		                         }]
	                    },
	                   {
		                  columnWidth:.5,
		                  layout: 'form',
		                  border:false,
		                  items: [{
				                  xtype:'textfield',
				                  fieldLabel: '客户编码',
				                  name: 'customercode',
				                  id:'customercode',
				                  anchor:'95%'
		                        },{
				                  xtype:'textfield',
				                  fieldLabel: '联系电话',
				                  name: 'linkertel',
				                  id:'linkertel',
				                  //value :record.get("linkertel"),
				                  anchor:'95%'
		                        }]
	                   }
	                   ] 
	//)主信息   
	                 },
	//(tabpanel部分
	                 {  
			            xtype:'tabpanel',
				    	id:'tabs',
			            plain:true,
			          	activeTab:0,
			            height:550,
			            layoutOnTabChange:true,
			            defaults:{bodyStyle:'padding:10px'}, 
	            		items:[ //所有信息
	            		       {//(企业信息 
	                			title:'企业信息',
	               				layout:'form',
	            				items: [{
	            							layout:'column',
	            							items:[
	            							       { //第一列
	                								columnWidth:.5,
	                								layout: 'form',
	                								items: [
	                                                        {
												                xtype:'textfield',
												                fieldLabel: '客户ID',
												                tabIndex : 1,
													      		maxLength : 20,
													      		minLength : 1,
												                name: 'idtclient',
												                id:'idtclient',
												                //value :record.get("idt_client"),
												                readOnly:true,
												                anchor:'95%'
	                                                        },
	                                                        {
											                    xtype:'textfield',
											                    fieldLabel: '企业规模',
											                   	tabIndex : 1,
																maxLength : 20,
																minLength : 1,
											                    name: 'scope',
											                    id:'scope',
											                    //value :record.get("SCOPE"),
											                    anchor:'95%'
	                                                        },
	                                                        /*{
											                    xtype:'textfield',
											                    fieldLabel: '组织代码',
											                    tabIndex : 1,
												      			maxLength : 20,
												      			minLength : 1,
											                    name: 'accountcode',
											                    id:'accountcode',
											                    //value :record.get("accountcode"),
											                    anchor:'95%'
	                                                        },
	                                                        {
											                    xtype:'textfield',
											                    fieldLabel: '组织名称',
											                   	tabIndex : 1,
																maxLength : 20,
																minLength : 1,
											                    name: 'accountname',
											                    id:'accountname',
											                    //value :record.get("accountname"),
											                    anchor:'95%'
	                                                        },*/
	                                                        {
												                xtype:'textfield',
												                fieldLabel: '法人生份证号码',
												                tabIndex : 1,
													      	    maxLength : 20,
													      		minLength : 1,
												                name: 'corporatorcode',
												                id:'corporatorcode',
												                //value :record.get("corporatorcode"),
												                anchor:'95%'
										                    },
										                    {
												                xtype:'textfield',
												                fieldLabel: '公司地址',
												                tabIndex : 1,
															    maxLength : 20,
																minLength : 1,
												                name: 'addresscop',
												                id:'addresscop',
												                //value :record.get("addresscop"),
												                anchor:'95%'
										                    },
										                    {
										                      xtype:'textfield',
										                      fieldLabel: '销售部地址',
										                      tabIndex : 1,
											      			  maxLength : 20,
											      			  minLength : 1,
										                      name: 'addresssale',
										                      id:'addresssale',
										                      //value :record.get("addresssale"),
										                      anchor:'95%'
									                        },
									                        {
										                      xtype:'textfield',
										                      fieldLabel: '发货地址',
										                      tabIndex : 1,
														      maxLength : 20,
															  minLength : 1,
										                      name: 'addressstock',
										                      id:'addressstock',
										                      //value :record.get("addressstock"),
										                      anchor:'95%'
									                        },
									                        {
											                  xtype:'textfield',
											                  fieldLabel: '法人地址',
											                  tabIndex : 1,
												      		  maxLength : 20,
												      		  minLength : 1,
											                  name: 'addresstran',
											                  id:'addresstran',
											                  //value :record.get("addresstran"),
											                  anchor:'95%'
										                    }   
	                                                       ]
	                                               },//第一列end	                                               
	                                               { //第二列begin
										             columnWidth:.5,
										             layout: 'form',
										             items:[{
											                   xtype:'textfield',
											                   fieldLabel: '联系人',
											                   tabIndex : 1,
															   maxLength : 20,
															   minLength : 1,
											                   name: 'linker',
											                   id:'linker',
											                   //value :record.get("linker"),
											                   anchor:'95%'
										                     },
										                     {
												                    xtype:'textfield',
												                    fieldLabel: '联系人手机',
												                    tabIndex : 1,
													      			maxLength : 20,
													      			minLength : 1,
												                    name: 'linkermobile',
												                    id:'linkermobile',
												                    //value :record.get("linkermobile"),
												                    anchor:'95%'
										                       },
										                       {
												                    xtype:'textfield',
												                    fieldLabel: '联系人传真',
												                   	tabIndex : 1,
																	maxLength : 20,
																	minLength : 1,
												                    name: 'linkerfax',
												                    id:'linkerfax',
												                    //value :record.get("linkerfax"),
												                    anchor:'95%'
										                       },
										                       {
												                    xtype:'textfield',
												                    fieldLabel: '联系人email',
												                    tabIndex : 1,
													      			maxLength : 20,
													      			minLength : 1,
												                    name: 'email',
												                    id:'email',
												                    //value :record.get("email"),
												                    anchor:'95%'
										                       },
										                       {
												                    xtype:'textfield',
												                    fieldLabel: '现经营产品',
												                   	tabIndex : 1,
																	maxLength : 20,
																	minLength : 1,
												                    name: 'product',
												                    id:'product',
												                    //value :record.get("product"),
												                    anchor:'95%'
	                                                           },
	                                                           {
												                    xtype:'textfield',
												                    fieldLabel: '信誉评估',
												                    tabIndex : 1,
													      			maxLength : 20,
													      			minLength : 1,
												                    name: 'creevaluate',
												                    id:'creevaluate',
												                    //value :record.get("creevaluate"),
												                    anchor:'95%'
										                      },
										                      {
														     	xtype : 'combo',
																store : new Ext.data.SimpleStore({
																fields : ["kind", "orderdeptName"],
															data : [['国营企业', '国营企业'],
															['中外合资企业', '中外合资企业'],
															['外资企业', '外资企业'],
															['私营企业', '私营企业'],
															['股份有限公司', '股份有限公司']
															]
																					}),
															valueField : "kind",
															displayField : "orderdeptName",
															mode : 'local',
															forceSelection : true,
						//									blankText : '请选择订单执行部门',
															emptyText : '选择企业性质',
															hiddenName : 'kind',
															editable : false,
															triggerAction : 'all',
															fieldLabel : '企业性质',
															//value:record.get("kind"),
															anchor : '95%'
												},
	                                                          {
		                    									xtype:'textfield',
		                    									fieldLabel: '注册资本',
											                    tabIndex : 1,
												      			maxLength : 20,
												      			minLength : 1,
											                    name: 'regmoney',
											                    id:'regmoney',
											                    //value :record.get("regmoney"),
											                    anchor:'95%'
	                                                          }   
										                   ]
										             }//第二列end
	                                               ]
	                                  }]//
	                                          
	                           },	//)企业信息 end
                                                       	                           
	                           {//（财务信息                         
								title:'财务信息',
								layout : 'column',
				
								items :[{//第一列
									       columnWidth : .5,
										   layout : 'form',
										   items :[
										           {
										           xtype:'textfield',
												   fieldLabel: '税号',
												   tabIndex : 1,
												   maxLength : 20,
												   minLength : 1,
												   name: 'taxno',
												   id:'taxno',
												   //value :record.get("taxno"),
												   anchor:'95%'
											       },
											      {
												    xtype : 'textfield',
												    fieldLabel : '银行帐号',
												    name :'accno',
												    id:'accno',
												    //value :record.get("accno"),
												    anchor : '95%'
											      },
											      {
										      		xtype : 'textfield',
											    	fieldLabel :'开户银行',
											    	name : 'bno',
											    	id:'bno',
												    //value :record.get("bno"),
												    anchor : '95%'
											      },
											      {
												    xtype : 'textfield',
												    fieldLabel : '开户银行地址',
												    name : 'baddr',
												    id:'baddr',
												    //value :record.get("baddr"),
												    anchor : '95%'
											      },
											      {
												    xtype : 'textfield',
												    fieldLabel : '第二开户银行',
												    name : 'bno1',
												    id:'bno1',
												    //value :record.get("bno1"),
												    anchor : '95%'
											      },
												  {
													xtype : 'textfield',
													fieldLabel : '第二银行帐号',
													name : 'accno1',
													id:'accno1',
													//value :record.get("accno1"),
													anchor : '95%'
												 } 
											    ]
								         }, 
								         {//第二列
										   columnWidth : .5,
										   layout : 'form',
										   items:
										        [
										         {
								     				xtype : 'textfield',
												    fieldLabel : '总公司地址',
										    		name : 'companyaddress',
											    	id:'companyaddress',
									    			//value :record.get("companyaddress"),
										    		anchor : '95%'
											     },
											     {
												   xtype : 'textfield',
												   fieldLabel : '财务编号',
												   name : 'cwno',
												   id:'cwno',
												   //value :record.get("cwno"),
												   anchor : '95%'
											     },
											     {
											       xtype : 'textfield',
												   fieldLabel : '财务名称',
												   name : 'cwname',
												   id:'cwname',
												   //value :record.get("cwname"),
												   anchor : '95%'
											     },
											     {
												   xtype : 'textfield',
												   fieldLabel : '财务地区',
												   name : 'cwzone',
												   id:'cwzone',
												   //value :record.get("cwzone"),
												   anchor : '95%'
											     },
											     {
												   xtype : 'textfield',
												   fieldLabel : '第二银行地址',
												   name : 'baddr1',
												   id:'baddr1',
												   //value :record.get("baddr1"),
												   anchor : '95%'
											     },
											     {
												   xtype : 'textfield',
												   fieldLabel : '未付款总额',
												   name : 'baddr1',
												   id:'baddr1',
												   //value :record.get("baddr1"),
												   anchor : '95%'
											     }		
								               ]
	                                    }
	                                   ]
	                          },//)财务信息end
	                          {//(其他
								title:'其他信息',
								layout : 'column',
	
								items : [{
									       columnWidth : .5,
									       layout : 'form',
									       items : 
									        [{
												xtype : 'textfield',
												fieldLabel : '国家',
												name : 'country',
												id:'country',
												//value :record.get("country"),
												anchor : '95%'
											},
											{
												xtype : 'textfield',
												fieldLabel : '县市',
												name : 'county',
												id:'county',
												//value :record.get("county"),
												anchor : '95%'
											},
											{
												xtype : 'textfield',
												fieldLabel : '村',
												name : 'status',
												id:'status',
												//value :record.get("status"),
												anchor : '95%'
											},
											{
											
											xtype : 'combo',
											store : new Ext.data.SimpleStore({
											fields : ["PAY_KIND", "orderdeptName"],
											data : [['现金', '现金'],
											['支票', '支票'],
											['银行卡', '银行卡'],
											['转帐', '转帐'],
											['未定', '未定'],
											['未支付', '未支付']
											]
																			}),
											valuefield : "pay_kind",
											displayField : "orderdeptName",
											mode : 'local',
											forceSelection : true,
											//value:a,
											hiddenname : 'pay_kind',
											editable : false,
											triggerAction : 'all',
											fieldLabel : '支付方式',
											anchor : '95%'	

											 },  
											 {
												xtype : 'textarea',
												fieldLabel : '备注',
												name : 'remark',
												id:'remark',
												//value :record.get("remark"),
												anchor : '95%'
											 }
											]
								         }, 
								         {
											columnWidth : .5,
											layout : 'form',
											items : [
											 {
												xtype : 'textfield',
												fieldLabel : '省份',
												name : 'province',
												id:'province',
												//value :record.get("province"),
												anchor : '95%'
											},
											{
												xtype : 'textfield',
												fieldLabel : '乡/镇',
												name : 'states',
												id:'states',
												//value :record.get("states"),
												anchor : '95%'
											},
											{
												xtype : 'textfield',
												fieldLabel : '邮编',
												name : 'postalcode',
												id:'postalcode',
												//value :record.get("postalcode"),
												anchor : '95%'
											},
											{
												xtype : 'textfield',
												fieldLabel : '考察评估意见',
												name : 'assess',
												id:'assess',
												//value :record.get("assess"),
												anchor : '95%'
											},
											{
												xtype : 'textarea',
												fieldLabel : '老板的文化程度',
												name : 'fancy',
												id:'fancy',
												//value :record.get("fancy"),
												anchor : '95%'
											}
											]
								         }
								        ]
	                           }
	//)其他            
	                           ]
	//)TABPANEL全部子信息            
	        }
//	        
	               ]
	//整页      
	
	
	   });
   
	//)整个form     
	//按钮   

	
	 var winid = 'editClient';
	 var win = new Ext.Window
	 ({
		  title : '修改客户',
		  width : 720,
		  height : 450,
		  id : winid,
		  layout : 'fit',
		  plain : true,
		  bodyStyle : 'padding:5px;',
		  buttonAlign : 'center',
		  resizable : false,
		  items : formPanel,
		  modal : true,
		  buttons : [{
					   text : '修改保存',
					   tabIndex : 24,
					   handler : function() 
					   {
						 if (formPanel.form.isValid()) 
						 {
						   formPanel.form.submit(
						   {
						      waitTitle : "请稍候",
						      waitMsg : '正在修改保存数据...',						      
						      params : 
						      {
						        trancode : '11113',
						        id : record.get("idtclient")
						      },
						      method : 'Post',
						      failure : function(form, action) 
						      {
						        Ext.MessageBox.alert('操作失败', action.result.message);
						      },
						      success : function(form, action) 
						      {
						         if (action.result.success) 
						         {
						           Ext.MessageBox.alert('操作成功',
						           action.result.message);
						           ds.load({params:{start:0, limit:App.pageSize}});
						           Ext.getCmp(winid).close();
						         } 
						         else 
						         {
						           Ext.MessageBox.alert('操作失败',
						           action.result.message);
						         }
						      }
						   });
						  } 
						  else 
						  {
						     Ext.MessageBox.alert('输入错误', '请输完内容后再保存！');
						  }
					   }
					 }, 
					 {
					   text : '取消',
					   tabIndex : 25,
					   handler : function() 
					   {
						  Ext.getCmp(winid).close();
					   }
		             }
		            ]
	 });
	  win.on('show',function(){
	 	formPanel.getForm().loadRecord(record);
	 });
	var tabs = Ext.getCmp('tabs');//获得容器组建
	tabs.on('afterlayout',function(){formPanel.getForm().loadRecord(record);});
	 win.show();//注意win.show()与win.show(button)的区别，show(button)会使弹出窗口看起来象从button上弹出来的，具有动画效果，而win.show()则没有这一动画效果
};
